package com.lzc.springboot.service.impl;

import com.lzc.springboot.domain.ShowDisease;
import com.lzc.springboot.mapper.DiseaseMapper;
import com.lzc.springboot.service.DiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;

@Service
public class DiseaseServiceImpl implements DiseaseService {

  @Autowired
  private DiseaseMapper diseaseMapper;

  @Override
  public ShowDisease[] findDisByCropId(int cropId) {
    return diseaseMapper.findDisByCropId(cropId);
  }

  @Override
  public ShowDisease[] findDisByText(String text) {
    if ("".equals(text)){
      return null;
    }
    return diseaseMapper.findDisByText(text);
  }
}
